<template>
  <div @click="go">page2</div>
  <div>{{ userInfo.name }}</div>
</template>

<script>
import {mapState} from "pinia";
import useUserStore from "../store/index.js";

export default {
  name: "Page2",
  computed:{
    ...mapState(useUserStore,['userInfo'])
  },
  methods:{
    go(){
      this.$router.push('/')
    }
  }
}
</script>

<style scoped>

</style>